package com.foreknow.demo3;

public class Test {
    public static void main(String[] args) {
        //动态初始化
        int[] arr = new int[4];
        arr[0] = 10;
        arr[1] = 20;
        arr[2] = 30;
        arr[3] = 40;
        //静态初始化
        int[] scores = {80,23,45,67,90};
        int sum = 0;
        for (int i = 0;i<scores.length;i++){
            sum += scores[i];
        }
        double avg = (double)sum/scores.length;
        System.out.println(avg);
    }
}
